package dataMapper;

import java.io.BufferedReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import dataEntity.HealthyPeople2010;

public class HealthyPeople2010Mapper {
	public static  Map<String,HealthyPeople2010> process(BufferedReader br){
		Map<String,HealthyPeople2010> map = new HashMap<String,HealthyPeople2010>();
		try {
			br.readLine();
			while(br.ready()){
				HealthyPeople2010 object = buildObject(br.readLine());

//				map.put(object.getCHSI_State_Abbr() + "," + object.getCHSI_County_Name(), object);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		return map;
	}
	
	public static  HealthyPeople2010 buildObject(String inLine){
		String[] line = inLine.split(",");
		HealthyPeople2010 object = new HealthyPeople2010();
		
		object.setCategories(line[0]);
		object.setElements(line[1]);
		object.setUS_Pct_or_Rate_2003(line[2]);
		object.setHealthy_People_2010_Target(line[3]);

		return object;
	}
}
